from selenium.webdriver.common.by import By

from framwork.pages.base_page import BasePage


class LogPage(BasePage):
    """日志页面"""
    url = 'http://192.168.1.23/crm/index.php?m=log'
    # === 3. 元素定位器（集中管理，便于维护） ===
    btn_more_locator = (By.LINK_TEXT, '更多')  # 更多
    btn_log_locator = (By.XPATH, '//a[text()="日志"]')  # 日志
    btn_add_log_locator = (By.LINK_TEXT, '新建日志')  # 新建日志

    def click_more_button(self):
        """点击更多下拉框"""
        self.click(self.btn_more_locator)

    def click_log_button(self):
        """点击日志按钮"""
        self.click(self.btn_log_locator)

    def click_add_log_button(self):
        """点击新增日志按钮"""
        self.click(self.btn_add_log_locator)

